<%@page contentType="text/html; charset=UTF-8" language="java" import="java.sql.*" errorPage="" %>
<%@page pageEncoding="UTF-8"%>
<%@page import="orest.back.achieve.UserSessionAction"%>
<%@page import="orest.common.valueobject.UserSessionInfo"%>
<%@page import="orest.common.util.Tools"%>
<%@page import="java.util.*"%>
<%@page import="orest.common.util.CachedObject"%>
<%@page import="orest.common.util.CacheManager"%>
<%@page import="orest.common.util.ContecxtOperation"%>


<%  
    //request.setCharacterEncoding("gbk");
    
    UserSessionAction userSession = new UserSessionAction();
    UserSessionInfo sessionInfo = userSession.findSessionObject(request);
    String userid = "";
    String usertype = "";   
    String username=""; 
    String unitname="";  
    String enjoytype="";  
    String isenabled="";  
    String ischeck="";
    double remainmoney = 0.0D;
   
    
   
    if (sessionInfo != null){

        userid = sessionInfo.getUserID();
        usertype = sessionInfo.getUserType();      
        username = sessionInfo.getUserName(); 
        unitname = sessionInfo.getUnitName();  
        enjoytype = sessionInfo.getEnjoyType();  
        isenabled = sessionInfo.getIsEnabled();  
        ischeck = sessionInfo.getIsCheck();
        remainmoney = sessionInfo.getRemainMoney();      
    } 
 
 
%>



<meta http-equiv="x-ua-compatible" content="ie=7" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="../common/js/check.js"></script>
<script type="text/javascript" src="../common/js/pool.js"></script>
<script language = "javascript" src = "../common/js/Std_StranJF.js" type = "text/javascript"></script>
<script type="text/javascript" src="../common/js/transform.js"></script>
<script>
var data;
function logout() {
  
    location.href="http://" + location.host +"/common/logout.jsp";
}

function login() {
  
    var username = document.getElementById("username").value;
    var password = document.getElementById("password").value;
   
    if(IsEmpty(username)) {
    	alert("用户名不能为空！");
        return;
    }
    if(IsEmpty(password)) {
        alert("密码不能为空！");
        return;
    }
 
   
    var path = "http://" + location.host + "/common/agent/";
    
   
    var url = path+"login.jsp?username=" + username + "&password=" + password + "&jtime=" + (new Date()).getTime();
    
    
    XmlHttpPool.GetRemoteData(url, getLoginResult);
}

function getLoginResult(data) {

        var path_common = "http://" + location.host + "/common/";
	var URL = path_common + "common_top.jsp";		
	 if (data.indexOf("1")>=0) {
	    window.location.href=window.location.href;
	     window.location.reload();
                   
	}
	else {
             if (data.indexOf("2")>=0) 
                alert("您的用户信息尚未激活，请激活后再登陆");
             else
                alert("登录失败！请检查用户名和密码是否正确。");        	
	}
	 
	
}


function submitlogin(event){ 
      var event=window.event?window.event:event;      
      if(event.keyCode==13){ 
        login();
      } 
} 
 
function setHomepage(){//设置首页 
   if(document.all){
      document.body.style.behavior='url(#default#homepage)';
      document.body.setHomePage('http://www.chinanest.cn');
   }
   else if(window.sidebar){
        if(window.netscape){
             try{
                 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
             }
             catch(e){
                 alert("您的浏览器未启用[设为首页]功能，开启方法：先在地址栏内输入about:config,然后将项 signed.applets.codebase_principal_support 值该为true即可");
             }
        }
        var prefs=Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
        prefs.setCharPref('browser.startup.homepage','http://www.chinanest.cn');
   }
}


</script>



<div class="box_main" style="display:none;">
	<div class="blank10"></div>
	<div class="box_main2">

		<div class="box_left_3">		
		<%
			if (!userid.equals("")){
							
					out.println("<div style='line-height:26px;'>欢迎您! <font color='red'>"+userid+" </font>登录国家安科网! [<a href='/membercenter/index.jsp' >会员中心</a>][<a href='/commentary/addUserMessage.jsp' >用户留言</a>][<a href='javascript:logout();' >退出</a>]</div>");
		    			    	
		    	}else{
		%>
			<font color='#020202'>用户名:</font><input type="text" class="input_text_grey" id="username" name="username" value="" size=10 onFocus="if (value ==''){value =''}" onBlur="if (value ==''){value=''}"/>
			
			<font color='#020202'>密码:</font><input name="password" class="input_text_grey" id="password" type="password" value=""  size=8  onFocus="if (value ==''){value =''}" onBlur="if (value ==''){value=''}"/> 
			<input name="button"  type="button"   value="登  录" class="btn_login" onclick="login()" />
			<a href="../membercenter/FrontUserAdd.jsp" target="_blank">免费注册</a>	
                       	<a href="../membercenter/getpassword.jsp" target="_blank">找回密码</a>
                       	<a href="../commentary/addUserMessage.jsp" target="_blank">用户留言</a>				
		  <input type="hidden" name="forward" value="" />
		  <input type="hidden" name="dosubmit" value="1" />
		
		<%}%>	
		</div>
		
				
		<div class="box_right_3">
			<span class="common_right">
			
                        
			【<a href="#" onClick="setHomepage();">设为首页</a>】
			【<a href="http://www.chinanest.cn/" onclick="window.external.addFavorite(this.href,this.title);return false;" title='国家安科网' rel="sidebar">加入收藏</a>】&nbsp;&nbsp;

			</span>
		</div>
</div>

<div class="blank5"></div>	
<div class="box_main3">

	<div class="btn_list">
			<button id="m1_tb_1" class="normaltab"  onmouseover="x:HoverLi('m1_',1,7,'normaltab','hovertab');"  onmouseout="x:xHoverLi('m1_',1,7,'normaltab','hovertab');"  onclick=changeurl(this,"1") >网站首页</button>
			<button id="m1_tb_2" class="normaltab"  onmouseover="i:HoverLi('m1_',2,7,'normaltab','hovertab');"  onmouseout="i:xHoverLi('m1_',2,7,'normaltab','hovertab');"  onclick=changeurl(this,"2") >行业动态</button>
			<button id="m1_tb_3" class="normaltab"  onmouseover="i:HoverLi('m1_',3,7,'normaltab','hovertab');"  onmouseout="i:xHoverLi('m1_',3,7,'normaltab','hovertab');"  onclick=changeurl(this,"3") >项目信息</button>
			<button id="m1_tb_4" class="normaltab"  onmouseover="i:HoverLi('m1_',4,7,'normaltab','hovertab');"  onmouseout="i:xHoverLi('m1_',4,7,'normaltab','hovertab');"  onclick=changeurl(this,"4") >行业专家</button>
			<button id="m1_tb_5" class="normaltab"  onmouseover="i:HoverLi('m1_',5,7,'normaltab','hovertab');"  onmouseout="i:xHoverLi('m1_',5,7,'normaltab','hovertab');"  onclick=changeurl(this,"5") >科研单位</button>
			<button id="m1_tb_6" class="normaltab"  onmouseover="i:HoverLi('m1_',6,7,'normaltab','hovertab');"  onmouseout="i:xHoverLi('m1_',6,7,'normaltab','hovertab');"  onclick=changeurl(this,"6") >技术市场</button>
			<button id="m1_tb_7" class="normaltab"  onmouseover="i:HoverLi('m1_',7,7,'normaltab','hovertab');"  onmouseout="i:xHoverLi('m1_',7,7,'normaltab','hovertab');"  onclick=changeurl(this,"7") >文献情报</button>
			
	</div>
	
</div>		
</div>


   
<Script> 
function changeurl(o,columntype) 
{ 

	if (columntype ==1) { 
    		window.location.href="http://" +location.host ; 
    		
 	}
 	if (columntype ==2) { 
    		window.location.href="http://" +location.host +  "/SSTA/industry/index.jsp";  
    		
 	}
 	if (columntype ==3) {
   		window.location.href="http://" +location.host + "/SSTA/achieve/index.jsp"; 
   		
 	}
 	if (columntype ==4) {
   		window.location.href="http://" +location.host +  "/SSTA/expert/index.jsp"; 
 	}
 	if (columntype ==5) {
   		window.location.href="http://" +location.host +  "/SSTA/unit/index.jsp"; 
 	}
 	if (columntype ==6) {
   		window.location.href="http://" +location.host +  "/SSTA/techmarket/index.jsp";  
 	}
 	if (columntype ==7) {
   		window.location.href="http://www.cnki.net/";  
 	}
 	
 

} 
</script>

